﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Model;
namespace DAL
{
  public  class 商品添加DAL
    {
        //查询商品类型
        public static DataSet ProductType()
        {
            return DBHelper.Duankaishi("select PTID,PTName from ProductType", null);
        }
        public static int ProductsAdd() {
            string sql = "insert into Products values(@ProductName,@PTID,@ProductJP,@ProductPrice)";
            List<SqlParameter> list = new List<SqlParameter>(){
           new SqlParameter("@ProductName",Products.ProductName),
           new SqlParameter("@PTID",Products.PTID),
           new SqlParameter("@ProductJP",Products.ProductJP),
           new SqlParameter("@ProductPrice",Products.ProductPrice),
           };
            return DBHelper.Update(sql, list.ToArray());
        }
    }
}
